home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / diagramf / dmfexmpl.mf < prev    next >
Text File  |  1993-01-11  |  4KB  |  115 lines

  1. %%% ====================================================================
  2. %%%  @METAFONT-file{
  3. %%%     author          = "Alan Jeffrey",
  4. %%%     version         = "1.1",
  5. %%%     date            = "02 June 1992",
  6. %%%     time            = "13:54:01 BST",
  7. %%%     filename        = "dmfexmpl.mf",
  8. %%%     address         = "School of Cognitive and Computing Sciences
  9. %%%                        University of Sussex
  10. %%%                        Brighton BN1 9QH
  11. %%%                        UK",
  12. %%%     telephone       = "+44 273 606755 x 3238",
  13. %%%     FAX             = "+44 273 678188",
  14. %%%     checksum        = "15329 114 377 3956",
  15. %%%     email           = "alanje@cogs.sussex.ac.uk",
  16. %%%     codetable       = "ISO/ASCII",
  17. %%%     keywords        = "diagrams, metafont",
  18. %%%     supported       = "yes",
  19. %%%     abstract        = "Example diagrams for the diagramf package.",
  20. %%%     docstring       = "These are the example diagrams for the
  21. %%%                        diagramf package, described in diagramf.tex.
  22. %%%
  23. %%%                        Copyright 1992 Alan Jeffrey.
  24. %%%
  25. %%%                        The checksum field above contains a CRC-16
  26. %%%                        checksum as the first value, followed by the
  27. %%%                        equivalent of the standard UNIX wc (word
  28. %%%                        count) utility output of lines, words, and
  29. %%%                        characters.  This is produced by Robert
  30. %%%                        Solovay's checksum utility.",
  31. %%%     package         = "diagramf",
  32. %%%     dependencies    = "diagramf.mf diagramf.sty arrows.mf",
  33. %%%     maintainer      = "Jeremy Gibbons",
  34. %%%     address-maintainer = "Department of Computer Science
  35. %%%                        University of Aukland
  36. %%%                        Private Bag
  37. %%%                        Aukland
  38. %%%                        New Zealand",
  39. %%%     email-maintainer = "jeremy@cs.aukuni.ac.nz",
  40. %%%  }
  41. %%% ====================================================================
  42. %%%
  43. %%% 25 Oct 1990, v1.0: Released version 1.0.
  44. %%%
  45. %%% 2 Jun 1992, v1.1: Added standard headers, and renamed the file
  46. %%%    from example.mf to dmfexmpl.mf.
  47.  
  48. mode_setup;
  49. input diagramf;
  50. input arrows;
  51.  
  52. vardef setoval@# text t =
  53.     setbox@# t;
  54.     draw hboxbl@#{hboxbr@#-hboxtl@#}
  55.              ..hboxbr@#{hboxtr@#-hboxbl@#}
  56.              ..hboxtr@#{hboxtl@#-hboxbr@#}
  57.              ..hboxtl@#{hboxbl@#-hboxtr@#}
  58.              ..cycle
  59. enddef;
  60.  
  61. begindiagram (1,48pt#,35pt#,0pt#);
  62.     hboxes (0 upto 4);
  63.     pickup pencircle scaled 0.4pt;
  64.     .5[hboxtl0,hboxtr0] = (.5w,h-3pt);
  65.     hboxtr1-hboxbl0 = (-10pt,-10pt);
  66.     hboxtl2-hboxbr0 = (10pt,-10pt);
  67.     hboxbr3 = 2/3[hboxbl0,hboxtr1];
  68.     hboxbl4 = 2/3[hboxbr0,hboxtl2];
  69.     drawarrow hboxbl0--top rt  hboxtr1;
  70.     drawarrow hboxbr0--top lft hboxtl2;
  71.     setoval0 "$\mathstrut a \vert b$";
  72.     setoval1 "$\mathstrut a$";
  73.     setoval2 "$\mathstrut b$";
  74.     setbox3  "$\mathstrut b$";
  75.     setbox4  "$\mathstrut a$";
  76. enddiagram;
  77.  
  78. begindiagram (2,30pt#,7pt#,2pt#);
  79.     hboxes (0);
  80.     pickup pencircle scaled 0.4pt;
  81.     .5[hboxl0,hboxr0] = (.5w,0);
  82.     draw hboxbl0..hboxtl0
  83.              ---hboxtr0..hboxbr0
  84.              ---cycle;
  85.     setbox0 "$g \circ h$";
  86. enddiagram;
  87.  
  88. begindiagram(3,120pt#,40pt#,0pt#);
  89.     hboxes (0 upto 6);
  90.     .5[hboxtr0,hboxbl0] = (.5w,.5[h,-d]);
  91.     hboxtl1=(0,h);
  92.     hboxtr2=(w,h);
  93.     hboxr3=(w,ypart hboxr0);
  94.     hboxbr4=(w,-d);
  95.     hboxbl5=(0,-d);
  96.     hboxl6=(0,ypart hboxl0);
  97.     pickup pencircle scaled 0.4pt;
  98.     drawarrow .5[hboxbr1,hboxtr1]--hboxtl0;
  99.     drawarrow .5[hboxbl2,hboxtl2]--hboxtr0;
  100.     drawarrow .5[hboxbl3,hboxtl3]--hboxr0;
  101.     drawarrow .5[hboxbl4,hboxtl4]--hboxbr0;
  102.     drawarrow .5[hboxbr5,hboxtr5]--hboxbl0;
  103.     drawarrow .5[hboxbr6,hboxtr6]--hboxl0;
  104.     prooflabel0;
  105.     setbox0 "$g \circ h$";
  106.     setbox1 "\tt hboxtl0";
  107.     setbox2 "\tt hboxtr0";
  108.     setbox3 "\tt hboxr0";
  109.     setbox4 "\tt hboxbr0";
  110.     setbox5 "\tt hboxbl0";
  111.     setbox6 "\tt hboxl0";
  112. enddiagram;
  113.  
  114. end;
  115.